<?php

/*
|--------------------------------------------------------------------------
| 权限码配置
|--------------------------------------------------------------------------
|
| 各身份的权限码集中在此配置
| 本示例配置以user和admin进行说明
|
| 对于一个身份来说，一个完整的权限码为：模块.权限
| 作为普通用户 user 时，检查其是否具有发布文章权限时，完整的权限码为：article.add
|
*/


/*
|--------------------------------------------------------------------------
| 普通用户权限码
|--------------------------------------------------------------------------
*/
$user = [
    'user' => [
        'name' => '用户管理',
        'permissions' => [
            'index' => ['name' => '查看用户', 'description' => '查看用户'],
            'create' => ['name' => '添加用户', 'description' => '添加用户'],
            'edit' => ['name' => '编辑用户', 'description' => '编辑用户'],
            'enable' => ['name' => '启用用户', 'description' => '启用用户'],
            'disable' => ['name' => '禁用用户', 'description' => '禁用用户'],
            'delete' => ['name' => '删除用户', 'description' => '删除用户'],
        ],
    ],
    'worker' => [
        'name' => '员工管理',
        'permissions' => [
            'index' => ['name' => '查看员工', 'description' => '查看员工'],
            'create' => ['name' => '添加员工', 'description' => '添加员工'],
            'edit' => ['name' => '编辑员工', 'description' => '编辑员工'],
            'enable' => ['name' => '启用员工', 'description' => '启用员工'],
            'disable' => ['name' => '禁用员工', 'description' => '禁用员工'],
            'delete' => ['name' => '删除员工', 'description' => '删除员工'],
            'authorize' => ['name' => '员工授权', 'description' => '员工授权'],
        ],
    ],

    'role' => [
        'name' => '角色管理',
        'permissions' => [
            'user' => ['name' => '普通用户角色管理', 'description' => '普通用户角色管理'],
            'worker' => ['name' => '员工用户角色管理', 'description' => '员工用户角色管理'],
        ],
    ],
    'setting' => [
        'name' => '系统设置',
        'permissions' => [
            'set' => ['name' => '更新设置', 'description' => '更新设置参数的值'],
            'param' => ['name' => '参数管理', 'description' => '参数管理'],

        ],
    ],
    'contract' => [
        'name' => '合同管理',
        'permissions' => [
            'payment_term' => ['name' => '付款条件', 'description' => '付款条件'],
        ],
    ],
    'common' => [
        'name' => '公共模块',
        'permissions' => [
            'linkage' => ['name' => '联动', 'description' => '联动'],
            'project_type' => ['name' => '项目类型管理', 'description' => '项目类型管理'],
            'sign_company' => ['name' => '签订公司', 'description' => '签订公司'],
            'external_contact' => ['name' => '项目来源/其他公司联系人', 'description' => '项目来源/其他公司联系人'],
            'finance_category' => ['name' => '费用类型', 'description' => '费用类型'],
        ],
    ],
];

/*
|--------------------------------------------------------------------------
| 后台管理员权限码
|--------------------------------------------------------------------------
*/
$admin = [
    'article' => [
        'name' => '文章管理',
        'permissions' => [
            'article' => ['name' => '文章管理', 'description' => '管理所有文章'],
            'comment' => ['name' => '评论管理', 'description' => '管理所有文章评论'],
            'tag' => ['name' => '标签管理', 'description' => '管理所有文章标签'],

            // ...
        ],
    ],
    'user' => [
        'name' => '用户管理',
        'permissions' => [
            'create' => ['name' => '添加用户', 'description' => '添加用户'],
            'edit' => ['name' => '编辑用户', 'description' => '编辑用户'],
            'enable' => ['name' => '启用用户', 'description' => '启用用户'],
            'disable' => ['name' => '禁用用户', 'description' => '禁用用户'],
            'delete' => ['name' => '删除用户', 'description' => '删除用户'],

            // ...
        ],
    ],

    // ...
];
$worker = [
    'user' => [
        'name' => '用户管理',
        'permissions' => [
            'index' => ['name' => '查看用户', 'description' => '查看用户'],
            'create' => ['name' => '添加用户', 'description' => '添加用户'],
            'edit' => ['name' => '编辑用户', 'description' => '编辑用户'],
            'enable' => ['name' => '启用用户', 'description' => '启用用户'],
            'disable' => ['name' => '禁用用户', 'description' => '禁用用户'],
            'delete' => ['name' => '删除用户', 'description' => '删除用户'],
        ],
    ],
    'worker' => [
        'name' => '员工管理',
        'permissions' => [
            'index' => ['name' => '查看员工', 'description' => '查看员工'],
            'create' => ['name' => '添加员工', 'description' => '添加员工'],
            'edit' => ['name' => '编辑员工', 'description' => '编辑员工'],
            'enable' => ['name' => '启用员工', 'description' => '启用员工'],
            'disable' => ['name' => '禁用员工', 'description' => '禁用员工'],
            'delete' => ['name' => '删除员工', 'description' => '删除员工'],
            'authorize' => ['name' => '员工授权', 'description' => '员工授权'],
        ],
    ],

    'role' => [
        'name' => '角色管理',
        'permissions' => [
            'user' => ['name' => '普通用户角色管理', 'description' => '普通用户角色管理'],
            'worker' => ['name' => '员工用户角色管理', 'description' => '员工用户角色管理'],
        ],
    ],
    'setting' => [
        'name' => '系统设置',
        'permissions' => [
            'set' => ['name' => '更新设置', 'description' => '更新设置参数的值'],
            'param' => ['name' => '参数管理', 'description' => '参数管理'],
        ],
    ],
    'common' => [
        'name' => '公共模块',
        'permissions' => [
            'linkage' => ['name' => '联动', 'description' => '联动'],
            'keyword' => ['name' => '车型关键字', 'description' => '车型关键字'],
        ],
    ],



];

// 注意要把所有身份权限定义组装成数组返回
return compact('user', 'admin','worker');
